![]() Acrobat file (147K) |
![]() ClarisWorks 4 file (39K) |
![]() not available yet |
TECHNOTE 1032 Release 1.1 |
FEBRUARY 1996 |
If your application generates PostScript directly, or you're considering writing an app that does, there are some techniques that will help your development efforts. This Technote explains these techniques, as well as gotchas that are either inadequately documented, or scattered across multiple documentation sources.
This Note is aimed at application developers who want to mix the PostScript and QuickDraw imaging models.
This means that the normal PostScript coordinate system you know and love has been transformed, i.e., coordinates now match the QuickDraw orientation. This actually makes things easier for you. When you include the QuickDraw representation of the PostScript you're sending, the coordinate system will be the same as the one you used for the PostScript. You don't have to think about converting the coordinates. If you do include a QuickDraw PICT so you can print to QuickDraw printers, you should bracket this QuickDraw representation with the PostScriptBegin and PostScriptEnd PicComments.
Also, if the user selects 2-up or a similar option in the print driver, all the coordinates get transformed behind your back by the driver. The consequence of your app "thinking" it knows the coordinate system is that your app may end up coloring outside the lines. That's another good reason to keep things simple so you don't outsmart yourself.
The LaserWriter driver attempts to save and restore the graphics state around Postscript that you're sending to the printer, but there are cases when you can confuse it. In one case, for example, your app generates PostScript which prints to multiple pages without telling the driver. Another example would be changing the PostScript pen size directly rather than via QuickDraw. In general, if you are changing the state, you need to restore it.
What this means to you is that any PostScript you send using the PostScriptHandle PicComment should be a single image. More specifically, it should meet the criteria established for an EPS image, as described in Adobe's PostScript Language Reference Manual, 2nd Edition, Appendix H. Following these guidelines will also help you avoid Gotcha #2.
The 'PREC' 103 resource has been defined as the proper place for an application to store its application-specific PostScript which needs to be sent to the printer with each job.
Applications which do not use this resource not only keep the LaserWriter driver from optimizing the PostScript it generates, but also create compatibility problems for future versions of the LaserWriter driver.
Thanks to Ingrid Kelly, Dave Hersey, and Guillermo Ortiz.
Return to Technotes Table of Contents
Return to About Macintosh Technotes
Return to Developer Services and Products
Send feedback to devfeedback@applelink.apple.com.
[last modified by fch on 14-Mar-96]